<template>
  <aside class="btn-box">
    <el-row type="flex" :gutter="15">
      <el-col :span="2">
        <el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" @click="showAddForm">新增</el-button>
        <warehouse-info-dialog ref="warehouseInfoForm" @reloadData="reloadData" />
      </el-col>
      <el-col :span="2">
        <el-button type="primary" icon="el-icon-download" size="mini" @click="downloadFun">导出</el-button>
      </el-col>
      <el-col :span="2">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="showSearchForm">检索</el-button>
        <warehouse-info-search ref="search" @searchContent="searchFun" />
      </el-col>
    </el-row>
  </aside>
</template>

<script>
import warehouseInfoDialog from './warehouse-info-dialog'
import warehouseInfoSearch from './warehouse-info-search'
export default {
  components: { warehouseInfoDialog, warehouseInfoSearch },
  data() {
    return {
      form: {
        name: ''
      },
      dialogFormVisible: false,
      formLabelWidth: '80px',
      dialogAddNew: false
    }
  },
  methods: {
    reloadData() {
      // console.log('relodd')
      this.$emit('reloadData')
    },
    showAddForm() {
      this.$refs.warehouseInfoForm.dialogAddNew = true
    },
    showSearchForm() {
      // console.log('search')
      this.$refs.search.dialogFormSearch = true
    },
    downloadFun() {
      this.$emit('downloadFun')
    },
    searchFun(val) {
      // console.log(val)
      this.$emit('searchFun', val)
    }
  }
}
</script>

<style lang="scss" scoped>
  .el-button {
    width: 100%;
  }
</style>
